﻿using Shop.RemoteModel.GoodsSku.Model;
using Shop.StoreGatewayModular.Interface;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Client;
using WeDonekRpc.HttpApiGateway;
using WeDonekRpc.HttpApiGateway.Model;

namespace Shop.StoreGatewayModular.Api
{
    [ApiRouteName("/shop/goods/sku/{name}")]
    internal class GoodsSkuApi : ApiController
    {
        private readonly IGoodsSkuService _Service;

        public GoodsSkuApi (IGoodsSkuService service)
        {
            this._Service = service;
        }
        public PagingResult<GoodsSkuDatum> Query (PagingParam<SkuQueryParam> obj)
        {
            return this._Service.Query(obj);
        }

        public GoodsSkuDatum[] Gets (long[] ids)
        {
            return this._Service.Gets(ids);
        }

        public GoodsSkuDto Get (LongParam<string> param)
        {
            return this._Service.Get(param.Id, param.Value);
        }

        public bool Set (LongParam<GoodsSkuSet> data)
        {
            return this._Service.Set(data.Id, data.Value);
        }
        public long Add (GoodsSkuAdd data)
        {
            return this._Service.Add(data);
        }
    }
}
